package net.mfjassociates.financial.expense.shared.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import net.mfjassociates.financial.expense.shared.domain.Report;
import javax.persistence.ManyToOne;
import net.mfjassociates.financial.expense.shared.domain.Category;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Digits;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.format.annotation.NumberFormat.Style;

import net.mfjassociates.financial.expense.shared.domain.TaxCode;

@RooJavaBean
@RooToString
@RooEntity
public class ReportDetail {

    @ManyToOne
    private Report report;

    @ManyToOne
    private Category category;

    @NumberFormat(style=Style.CURRENCY)
    private BigDecimal totalAmount;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date dateEncurred;

    @NumberFormat(style=Style.CURRENCY)
    private BigDecimal taxAmount;

    @ManyToOne
    private TaxCode taxCode;

    @NumberFormat(style=Style.CURRENCY)
    @Digits(integer = 6, fraction = 2)
    private BigDecimal noTaxAmount;
}
